Skip to content

lib: avoid unsafe array iteration in cli table - #65838

Open
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:lib-avoid-unsafe-array-iteration
Open

lib: avoid unsafe array iteration in cli table#65838
HoonDongKang wants to merge 1 commit into
nodejs:mainfrom
HoonDongKang:lib-avoid-unsafe-array-iteration

Conversation

@HoonDongKang

Copy link
Copy Markdown
Contributor

for...of relies on the user-mutable Array.prototype[Symbol.iterator], resulting in unsafe array iteration.

This replaces it with an index-based loop when rendering table rows.

Refs

Tests:

  • ./node test/parallel/test-console-table.js

Avoid unsafe array iteration because for...of relies on the
user-mutable Symbol.iterator. Use an index-based loop instead.

Signed-off-by: HoonDongKang <d159123@naver.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.18%. Comparing base (6f41e41) to head (5644cef).
⚠️ Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65838      +/-   ##
==========================================
+ Coverage   90.17%   90.18%   +0.01%     
==========================================
  Files         770      771       +1     
  Lines      264483   264624     +141     
  Branches    50262    50230      -32     
==========================================
+ Hits       238491   238646     +155     
+ Misses      16981    16959      -22     
- Partials     9011     9019       +8     
Files with missing lines Coverage Δ
lib/internal/cli_table.js 98.95% <100.00%> (+0.02%) ⬆️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants